The present invention generally relates to computer graphics processing. More specifically, the present invention relates to a method and system for generating subdivision surfaces in real-time for use in connection with computer graphics.
Subdivision surfaces are used to create smooth geometric surfaces. A subdivision surface is generated through subdivision. Every subdivision surface starts with an original polygonal surface. The original polygonal surface is subdivided into additional polygons and all the vertices are moved according to some set of rules. The rules for moving the vertices vary from scheme to scheme. Some rules, for example, involve keeping the old vertices around, optionally moving them, and introducing new vertices.
One of the schemes that is commonly used is the loop surface subdivision scheme. The loop surface subdivision scheme works by generating and inserting extra vertices and then displacing the original vertices by predefined weighting constants. The subdivision surface is gradually smoothed with every subdivision step. The extra vertices are generated based on the original vertices and are inserted in the middle of edges defined by each pair of original vertices. Each existing vertex is influenced by other vertices it is connected to, as additional detailed geometry through subdivision is recursively generated. In addition to the loop surface subdivision scheme, a number of other schemes, such as the polyhedral scheme, are available to be used to generate subdivision surfaces.
Subdivision surfaces are used regularly in the computer graphics industry, most notably, for animated films or productions. However, due to expensive processing and overhead costs, use of subdivision surfaces has almost exclusively been limited to non real-time applications, such as graphic art packages and movie/television production.
One scheme has been introduced to attempt to generate subdivision surfaces in real-time. Such scheme works by administering a large complex database of geometry pointers and edges which are used to create the subdivided primitive. The use of a large complex database leads to large code size and many processing inefficiencies. Hence, it would be desirable to provide an improved method and system which is capable of generating subdivision surfaces in a more efficient manner so as to allow such subdivision surfaces to be implemented and utilized in real-time.
A method and system for generating subdivision surfaces in real-time for use in connection with computer graphics is provided. According to an exemplary embodiment of the present invention, face information and subdivision data for a subdivided face are first generated. The subdivided face is made up of a number of subdivision surfaces. The face information and subdivision data for the subdivided face respectively include vertices and edges, which define the subdivided face. Furthermore, two bitflags are associated with each edge identified in the subdivision data for the subdivided face. One bitflag is used to identify whether the associated edge is being used for a second time and the other bitflag is used to indicate whether the associated edge is used twice.
The subdivision data for the subdivided face is then used to generate subdivided and additional edges. Each edge identified by the subdivision data for the subdivided face is defined by a pair of subdivided edges. If an edge is used twice and is being used for the second time, the order of the subdivided edges which make up the edge is reversed. The face information for a subdivision surface is then generated using the face information and subdivision data for the subdivided face following a first predetermined methodology. The subdivision data for the subdivision surface is generated using the subdivided and additional edges following a second predetermined methodology. Similarly, the face information and subdivision data for the subdivision surface respectively include vertices and edges, which define the subdivision surface; and two bitflags are associated with each edge identified in the subdivision data for the subdivision surface.
After the respective face information and subdivision data for the subdivided face and subdivision surfaces are generated, new vertices are created for each edge which defines the subdivided face. An interior vertex bitflag is used to indicate whether a newly created vertex is an interior vertex. If the new vertex is an interior vertex, then using a standard (xe2x85x9c,xe2x85x9c,xe2x85x9,xe2x85x9) vertex weighting system, the blending weight for an edge-sharing neighbor vertex is halved. All the vertices are then displaced to create a smoother subdivided face.